<template>
  <div :class="[posterImageStatus ? 'noscroll product-con' : 'product-con']">
    <product-con-swiper :img-urls="storeInfo.sliderImageArr"></product-con-swiper>
    <div class="wrapper">
      <div class="share acea-row row-between row-bottom">
        <div class="money font-color-red">
          ￥
          <span class="num">{{ storeInfo.price }}</span>
          <span
            class="vip-money"
            v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
          >￥{{ storeInfo.vipPrice }}</span>
          <img
            :src="$VUE_APP_RESOURCES_URL+'/images/vip.png'"
            class="image"
            v-if="storeInfo.vipPrice && storeInfo.vipPrice > 0"
          />
        </div>
        <div class="iconfont icon-fenxiang" @click="listenerActionSheet"></div>
      </div>
      <div class="introduce">{{ storeInfo.storeName }}</div>
      <div class="label acea-row row-between-wrapper">
        <div>原价:￥{{ storeInfo.otPrice }}</div>
        <div>库存:{{ storeInfo.stock }}{{ storeInfo.unitName }}</div>
        <div>销量:{{ storeInfo.sales }}{{ storeInfo.unitName }}</div>
      </div>
      <div class="coupon acea-row row-between-wrapper" @click="couponTap" v-if="couponList.length">
        <div class="hide line1 acea-row">
          优惠券：
          <div
            class="activity"
            v-for="(item, couponListEq) in couponList"
            :key="couponListEq"
          >满{{ item.use_min_price }}减{{ item.coupon_price }}</div>
        </div>
        <div class="iconfont icon-jiantou"></div>
      </div>
    </div>
    <div class="attribute acea-row row-between-wrapper" @click="selecAttrTap">
      <div>
        {{ attrTxt }}：
        <span class="atterTxt">{{ attrValue }}</span>
      </div>
      <div class="iconfont icon-jiantou"></div>
    </div>
    <div class="store-info" v-if="system_store.id !== undefined">
      <div class="title">门店信息</div>
      <div class="info acea-row row-between-wrapper">
        <div class="picTxt acea-row row-between-wrapper">
          <div class="pictrue">
            <img :src="system_store.image" />
          </div>
          <div class="text">
            <div class="name line1">{{ system_store.name }}</div>
            <div class="address acea-row row-middle" @click="showChang">
              <span class="addressTxt line1">
                {{
                system_store._detailed_address
                }}
              </span>
              <span class="iconfont icon-youjian"></span>
            </div>
          </div>
        </div>
        <!-- <a class="iconfont icon-dadianhua01 font-color-red" :href="'tel:' + system_store.phone"></a> -->
      </div>
    </div>
    <div class="userEvaluation" v-if="replyCount">
      <div class="title acea-row row-between-wrapper">
        <div>用户评价({{ replyCount }})</div>
        <div
          @click="$router.push({ path: '/pages/shop/EvaluateList/main',query:{id}})"
          class="praise"
        >
          <span class="font-color-red">{{ replyChance }}%</span>好评率
          <span class="iconfont icon-jiantou"></span>
        </div>
      </div>
      <user-evaluation :reply="reply"></user-evaluation>
    </div>
    <div class="superior">
      <div class="title acea-row row-center-wrapper">
        <img :src="$VUE_APP_RESOURCES_URL+'/images/ling.png'" />
        <div class="titleTxt">优品推荐</div>
        <img :src="$VUE_APP_RESOURCES_URL+'/images/ling.png'" />
      </div>
      <template>
        <div class="slider-banner banner">
          <swiper :options="swiperRecommend" v-if="goodList.length > 0">
            <swiper-slide v-for="(item, eq2) in goodList" :key="eq2">
              <div class="list acea-row row-middle">
                <div class="item" v-for="val in item.list" :key="val.image">
                  <div class="pictrue">
                    <img :src="val.image" />
                  </div>
                  <div class="name line1">{{ val.store_name }}}</div>
                  <div class="money font-color-red">¥{{ val.price }}</div>
                </div>
              </div>
            </swiper-slide>
            <div class="swiper-pagination" slot="pagination"></div>
          </swiper>
        </div>
      </template>
    </div>
    <div class="product-intro">
      <div class="title">产品介绍</div>
      <div class="conter" v-html="storeInfo.description"></div>
    </div>
    <div style="height:100rpx;"></div>
    <div class="footer acea-row row-between-wrapper">
      <!--<div class="item" @click="$router.push({ path: '/pages/user/CustomerList/main' })">-->
      <!--<div class="iconfont icon-kefu"></div>-->
      <!--<div>客服</div>-->
      <!--</div>-->
      <div class="item" @click="setCollect">
        <div class="iconfont" :class="storeInfo.userCollect ? 'icon-shoucang1' : 'icon-shoucang'"></div>
        <div>收藏</div>
      </div>
      <div
        @click="$router.push('/pages/shop/ShoppingCart/main')"
        class="item animated"
        :class="animated === true ? 'bounceIn' : ''"
      >
        <div class="iconfont icon-gouwuche1">
          <span class="num bg-color-red" v-if="CartCount > 0">
            {{
            CartCount
            }}
          </span>
        </div>
        <div>购物车</div>
      </div>
      <div class="bnt acea-row">
        <div class="joinCart" @click="joinCart">加入购物车</div>
        <div class="buy" @click="tapBuy">立即购买</div>
      </div>
    </div>
    <CouponPop v-on:changeFun="changeFun" :coupon="coupon"></CouponPop>
    <ProductWindow v-on:changeFun="changeFun" :attr="attr" :cartNum="cart_num"></ProductWindow>
    <StorePoster
      v-on:setPosterImageStatus="setPosterImageStatus"
      :posterImageStatus="posterImageStatus"
      :posterData="posterData"
    ></StorePoster>
    <ShareInfo v-on:setShareInfoStatus="setShareInfoStatus" :shareInfoStatus="shareInfoStatus"></ShareInfo>
    <div class="generate-posters acea-row row-middle" :class="posters ? 'on' : ''">
      <div class="item" v-if="weixinStatus === true" @click="setShareInfoStatus">
        <div class="iconfont icon-weixin3"></div>
        <div class>发送给朋友</div>
      </div>
      <div class="item" @click="setPosterImageStatus">
        <div class="iconfont icon-haibao"></div>
        <div class>生成海报</div>
      </div>
    </div>
    <div class="mask" @touchmove.prevent @click="listenerActionClose" v-show="posters"></div>
    <div class="geoPage" v-if="mapShow">
      <iframe
        width="100%"
        height="100%"
        frameborder="0"
        scrolling="no"
        :src="'https://apis.map.qq.com/uri/v1/geocoder?coord=' +system_store.latitude +',' +system_store.longitude +'&referer=' +mapKey"
      ></iframe>
    </div>
  </div>
</template>
<style scoped>
.geoPage {
  position: fixed;
  width: 100%;
  height: 100%;
  top: 0;
  z-index: 10000;
}
.product-con .store-info {
  margin-top: 0.2rem;
  background-color: #fff;
}
.product-con .store-info .title {
  padding: 0 0.3rem;
  font-size: 0.28rem;
  color: #282828;
  height: 0.8rem;
  line-height: 0.8rem;
  border-bottom: 0.01rem solid #f5f5f5;
}
.product-con .store-info .info {
  padding: 0 0.3rem;
  height: 1.26rem;
}
.product-con .store-info .info .picTxt {
  width: 6.15rem;
}
.product-con .store-info .info .picTxt .pictrue {
  width: 0.76rem;
  height: 0.76rem;
}
.product-con .store-info .info .picTxt .pictrue img {
  width: 100%;
  height: 100%;
  border-radius: 0.06rem;
}
.product-con .store-info .info .picTxt .text {
  width: 5.22rem;
}
.product-con .store-info .info .picTxt .text .name {
  font-size: 0.3rem;
  color: #282828;
}
.product-con .store-info .info .picTxt .text .address {
  font-size: 0.24rem;
  color: #666;
  margin-top: 0.03rem;
}
.product-con .store-info .info .picTxt .text .address .iconfont {
  color: #707070;
  font-size: 0.18rem;
  margin-left: 0.1rem;
}
.product-con .store-info .info .picTxt .text .address .addressTxt {
  width: 4.8rem;
}
.product-con .store-info .info .iconfont {
  font-size: 0.4rem;
}
.product-con .superior {
  background-color: #fff;
  margin-top: 0.2rem;
}
.product-con .superior .title {
  height: 0.98rem;
}
.product-con .superior .title img {
  width: 0.3rem;
  height: 0.3rem;
}
.product-con .superior .title .titleTxt {
  margin: 0 0.2rem;
  font-size: 0.3rem;
  background-image: linear-gradient(to right, #f57a37 0%, #f21b07 100%);
  background-image: -webkit-linear-gradient(to right, #f57a37 0%, #f21b07 100%);
  background-image: -moz-linear-gradient(to right, #f57a37 0%, #f21b07 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.product-con .superior .slider-banner {
  width: 6.9rem;
  margin: 0 auto;
  padding-bottom: 0.2rem;
}
.product-con .superior .slider-banner .list {
  width: 100%;
  padding-bottom: 0.2rem;
}
.product-con .superior .slider-banner .list .item {
  width: 2.15rem;
  margin: 0 0.22rem 0.3rem 0;
  font-size: 0.26rem;
}
.product-con .superior .slider-banner .list .item:nth-of-type(3n) {
  margin-right: 0;
}
.product-con .superior .slider-banner .list .item .pictrue {
  width: 100%;
  height: 2.15rem;
}
.product-con .superior .slider-banner .list .item .pictrue img {
  width: 100%;
  height: 100%;
  border-radius: 0.06rem;
}
.product-con .superior .slider-banner .list .item .name {
  color: #282828;
  margin-top: 0.12rem;
}
.product-con .superior .slider-banner .swiper-pagination-bullet {
  background-color: #999;
}
.product-con .superior .slider-banner .swiper-pagination-bullet-active {
  background-color: #e93323;
}

.mask {
  -webkit-filter: blur(2px);
  -moz-filter: blur(2px);
  -ms-filter: blur(2px);
  filter: blur(2px);
}
.footer .icon-shoucang1 {
  color: #73cbb6;
}
.product-con .product-intro .conter div {
  width: 100% !important;
}
.generate-posters {
  width: 100%;
  height: 1.7rem;
  background-color: #fff;
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 99;
  transform: translate3d(0, 100%, 0);
  -webkit-transform: translate3d(0, 100%, 0);
  -ms-transform: translate3d(0, 100%, 0);
  -moz-transform: translate3d(0, 100%, 0);
  -o-transform: translate3d(0, 100%, 0);
  transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  -webkit-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  -moz-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
  -o-transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9);
}
.generate-posters.on {
  transform: translate3d(0, 0, 0);
  -webkit-transform: translate3d(0, 0, 0);
  -ms-transform: translate3d(0, 0, 0);
  -moz-transform: translate3d(0, 0, 0);
  -o-transform: translate3d(0, 0, 0);
}
.generate-posters .item {
  flex: 50%;
  -webkit-flex: 50%;
  -ms-flex: 50%;
  text-align: center;
}
.generate-posters .item .iconfont {
  font-size: 0.8rem;
  color: #5eae72;
}
.generate-posters .item .iconfont.icon-haibao {
  color: #5391f1;
}
.noscroll {
  height: 100%;
  overflow: hidden;
}
</style>

<script>
export default {
    data(){
        return{
            id: '',
            name: '',
            list: []
        }
    },
    onLoad: function (option) { //option为object类型，会序列化上个页面传递的参数
        let that = this
        that.id = option.id
        that.name = option.name
        console.log(option.id); //打印出上个页面传递的参数。
        console.log(option.name); //打印出上个页面传递的参数。
        let _that=this
					_that.$myRequest('/product/newdetail/'+this.id+'',{},'GET').then((res) => {
						console.log(res)
						
					}).catch((err) => {
						
					});
    }
}
</script>

